<template>
  <div id="container" style="margin-left:60px;width: 1000px;height: 400px"></div>
</template>
<script>

import BMapGL from "BMapGL"

export default {

  mounted() {
    this.initMap();
  },
  methods: {
    initMap: function () {
      let lo=sessionStorage.getItem("author")

      let map = new BMapGL.Map('container');
      map.centerAndZoom(new BMapGL.Point(1.0,9.0), 12);
      //创建地址解析器实例
      var myGeo = new BMapGL.Geocoder();
      // 将地址解析结果显示在地图上，并调整地图视野
      myGeo.getPoint(lo, function(point){
        if(point){
          map.centerAndZoom(point, 16);
          map.addOverlay(new BMapGL.Marker(point))
        }else{
          alert('您选择的地址没有解析到结果！');
        }
      }, lo )

    },



  }
}

</script>
<style scoped>
.amap-page-container {
  width: 100%;
  height: 400px;
}
</style>
